package com.bajiao.dto.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @Description: 用户
 * @Author: FanJq
 * @Date:   2024-12-31
 * @Version: V1.0
 */
@Data
@TableName("user")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("UserDTO")
public class UserDTO {

    @ApiModelProperty(value = "用户昵称")
    @Length(max = 10, message = "用户昵称太长")
	private String nickname;

    @ApiModelProperty(value = "头像")
	private String avatar;

    @ApiModelProperty(value = "性别（1-男 2-女）")
    @Range(min = 1, max = 2, message = "性别选择有误")
	private Integer sex;

	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "生日（yyyy-MM-dd）")
	private Date birthday;

    @ApiModelProperty(value = "简介")
    @Length(max = 200, message = "简介太长")
	private String introduction;

}
